//
//  THWURLProtocol.m
//  Assistant
//
//  Created by 秦慕乔 on 2017/8/2.
//  Copyright © 2017年 秦慕乔. All rights reserved.
//

#import "THWURLProtocol.h"
#import "AppDelegate.h"
@implementation THWURLProtocol

+ (void)load {
    [NSURLProtocol registerClass:self];
}



+ (BOOL)canInitWithRequest:(NSURLRequest *)request {
    
    if ([request isKindOfClass:[NSMutableURLRequest class]]) {
        AppDelegate *appdelegate=(AppDelegate *)[UIApplication sharedApplication].delegate;
//        NSDictionary *headDic = appdelegate.appKeyChainDic;
//        for (NSString *key in headDic.allKeys) {
//            NSString *value = headDic[key];
//            if(![request.allHTTPHeaderFields.allKeys containsObject:key])
//            {
//                [(id)request setValue:value forHTTPHeaderField:key];
//            }
//        }
        
    }
    return NO;
    
}

@end
